/**
 * 
 */



$(function(){
	$(".project").hover3d({
		selector: ".project__card",
		shine: true,
		sensitivity:10,    //设置左上角距离
	});
});



//每次刷新首页时发送请求
$(function(){
	$.get("User_jurisdiction_servlet",function(data,status){
		if(data.result){
			//alert(data.nickname);
			$("#head_photo").removeClass("hide");
			$("#login").addClass("hide");
			$("#register").addClass("hide");
			
			$("#sign_out").removeClass("hide");
			$("#news").removeClass("hide");
			$("#nickname").removeClass("hide");
			$("#nickname").html(data.nickname);
			
			if(data.user_photo_path!=""&&data.user_photo_path!=null){
				$("#user_photo")[0].src=data.user_photo_path;
			}else{
				$("#user_photo")[0].src="images/no_photo.jpg";
			}
		}
	},
	"json"
	);
});



//退出系统
$(function(){
	$("#sign_out").click(function(){
		$.get("Sign_out",function(data,status){
			if(data.result==true){
			window.location.href="index.jsp";	
			}else{
				alert("退出失败");
			}
		},"json");
	});
});